﻿<div id="content">
    <div class="container_box" style="margin-right:20px">
        <div class="row cpInfo">
            <div smart-include="project/views/sub-header.tpl.html"></div>
            <div class="col-xs-12">
                <div class="line"></div>
            </div>
        </div>
        <div class="row">
            <h1 class="margin-bottom-30 margin-top-20 clearfix">
                <div class="col-sm-2">
                    <h6>设备编号：</h6>
                    <select class="form-control" ng-model="bindObj.device_id" id="device-id">
                        <option value="0" selected="selected">请选择设备编号</option>
                        <option ng-repeat="device in devices" value="{{device.id}}">{{device.deviceid}}</option>
                    </select>
                </div>
                <div class="col-sm-2">
                    <h6>项目：</h6>
                    <select class="form-control" ng-model="bindObj.pid">
                        <option value="0" selected="selected">请选择项目名称</option>
                        <option ng-repeat="project in projects" value="{{project.id}}">{{project.name}}</option>
                    </select>
                </div>
                <div class="col-sm-2">
                    <button class="btn btn-primary" style="margin-top:40px;" id="m1" ng-click="bind_dialog()">绑定</button>
                </div>
            </h1>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <div data-widget-colorbutton="false" data-widget-togglebutton="false" data-widget-editbutton="false" data-widget-fullscreenbutton="false" data-widget-deletebutton="false" data-widget-color="blueDark" data-jarvis-widget="" class="jarviswidget-color-blueDark jarviswidget jarviswidget-sortable" role="widget">
                    <header role="heading" class="ui-sortable-handle">
                        <span class="widget-icon"> <i class="fa fa-arrow-down"></i> </span>
                        <h2><strong>设备数据</strong></h2>
                        
                    <span class="jarviswidget-loader"><i class="fa fa-refresh fa-spin"></i></span></header>
                    <!-- widget div-->
                    <div role="content">
                        <!-- widget content -->
                        <div class="widget-body"><div class="jarviswidget-editbox"><input class="form-control" type="text"></div>
                            <div class="table-responsive">
                                <table class="table table-bordered table-hover" id="device_table">
                                    <thead>
                                        <th>序号</th>
                                        <th>设备名称</th>
                                        <th>设备编号</th>
                                        <th>客户名称</th>
                                        <th>地址</th>
                                        <th>地理位置</th>
                                        <th>采集周期</th>
                                        <th>信号</th>
                                        <th>状态</th>
                                        <th>fid</th>
                                        <th>pid</th>
                                    </thead>
                                    <tbody>
                                        <tr ng-repeat="device in devices">
                                            <td>{{device.id}}</td>
                                            <td>{{device.name}}</td>
                                            <td>{{device.device_id}}</td>
                                            <td>{{device.clientname}}</td>
                                            <td>{{device.address}}</td>
                                            <td>{{device.pos}}</td>
                                            <td>{{device.col-cycle}}</td>
                                            <td>{{device.signal}}</td>
                                            <td>{{device.status}}</td>
                                            <td>{{device.fid}}</td>
                                            <td>{{device.pid}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>                                    
                        </div>
                        <!-- end widget content -->
                    </div>
                    <!-- end widget div -->
                </div>

            </div>
        </div>
    </div>
    
</div>
<div class="modal fade" id="bind" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    ×
                </button>
                <h4 class="modal-title">提示</h4>
            </div>
            <div class="modal-body">
                <p>
                    是否绑定该设备到该项目？
                </p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">
                    取消
                </button>
                <button type="button" class="btn btn-primary" ng-click="bind()">
                    确认
                </button>
            </div>
        </div>
    </div><!-- /.modal-content -->
</div>